<div class="msgLogin">
  <form class="form" dForm ngForm [dValidateRules]="formRules.rule" [layout]="layoutDirection"
    #userForm="dValidateRules" (dSubmit)="submitForm($event)">
    <d-form-item class="phonePrefix">
      <d-form-control>
        <d-select class="prefix" [overview]="'border'" [placeholder]="'+86'" [options]="options"></d-select>
        <input dTextInput class="phoneNum" name="phoneNum" minlength="3" autocomplete="off" placeholder="请输入手机号"
          [(ngModel)]="formData.phoneNum" [dValidateRules]="formRules.phoneNumRules"
          [ngModelOptions]="{ updateOn: 'change' }" #phoneNumValid="ngModel" (focus)="initial()" />
      </d-form-control>
    </d-form-item>
    <d-form-item>
      <div class="code">
        <d-form-control>
          <input dTextInput name="code" [(ngModel)]="formData.code" minlength="1" maxlength="6" placeholder="请输入验证码"
            [dValidateRules]="formRules.codeRules" [ngModelOptions]="{ updateOn: 'blur' }" #codeValid="ngModel"
            (focus)="initial()" />
        </d-form-control>
        <d-button class="getCode" [title]="userForm.errorMessage || ''" circled="true"
          [disabled]="!phoneNumValid.valid || countDown" (btnClick)="getCode()"><span *ngIf=!countDown>发送验证码</span>
          <app-countdown *ngIf=countDown [enddate]="starttime" type="getCode" (callGetList)="callGetList()">
          </app-countdown>
        </d-button>
      </div>
    </d-form-item>
    <div class="wrongMsg" *ngIf="wrongM && phoneNumValid.valid && codeValid.valid">{{ wrongMsg }}</div>
    <d-form-operation class="login-operation">
      <d-button class="login-btn" [title]="userForm.errorMessage || ''" circled="true" dFormSubmit>登录</d-button>
    </d-form-operation>
  </form>
  <div>
    <div class="register">
      <a (click)="closeDialog('register')">注册</a>
    </div>
  </div>
</div>
